package com.ebupt.migu.music.global.service;

import com.alibaba.fastjson.JSONArray;
import com.ebupt.migu.globalpopup.entity.*;
import com.ebupt.migu.music.common.entity.Page;
import com.ebupt.migu.music.common.entity.ResultObject;
import com.ebupt.migu.music.global.dto.PriorityRequestBean;
import com.ebupt.migu.music.global.dto.RateMonitor;
import com.ebupt.migu.music.global.vo.PopupExportVo;
import com.ebupt.migu.music.global.vo.PopupVo;
import com.ebupt.migu.music.system.entity.SysUser;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author liuyangyang@ebupt.com
 * @Description
 * @Date 2021/11/23 10:06
 */
public interface GlobalActionService {

    /**
     * 创建
     *
     * @param user
     * @param bean
     * @return
     */
    public ResultObject create(SysUser user, GlobalActionRequestBean bean);

    /**
     * 验重
     * 
     * @param bean
     * @return
     */
    Boolean isHasAds(GlobalActionRequestBean bean);

    /**
     * 查询
     *
     * @param user
     * @param bean
     * @return
     */
    public ResultObject select(SysUser user, QueryGlobalActionsRequestBean bean);

    /**
     * 查询
     *
     * @param bean
     * @return
     */
    public ResultObject selectById(QueryGlobalActionsRequestBean bean);

    /**
     * 更新
     *
     * @param user
     * @param bean
     * @return
     */
    public ResultObject update(SysUser user, GlobalActionRequestBean bean);

    /**
     * 删除
     *
     * @param user
     * @param activityIds
     * @return
     */
    public ResultObject delete(SysUser user, GlobalActionRequestBean activityIds);

    /**
     * 查询页面枚举
     *
     * @return
     */
    public ResultObject<JSONArray> pageEnum(PageEnum pageEnum);

    /**
     * 调整活动优先级
     *
     * @param bean
     * @return
     */
    public ResultObject priority(PriorityRequestBean bean);

    /**
     * Query file result object.
     *
     * @param params the params
     * @return the result object
     */
    ResultObject queryFile(Map<String, Object> params);

    /**
     * Revocation result object.
     *
     * @param activityInfo the activity info
     * @return the result object
     */
    ResultObject<String> revocation(ActivityInfo activityInfo);

    /**
     * Query map result object.
     *
     * @param params the params
     * @return the result object
     */
    ResultObject qryByIdAndTime(Map<String, Object> params);

    /**
     * Query map result object.
     *
     * @param params the params
     * @return the result object
     */
    ResultObject<Page<PopupVo>> queryMap(Map<String, Object> params);

    /**
     * 查询导出
     *
     * @param params
     * @return
     */
    List<PopupExportVo> exportMap(Map<String, Object> params);

    /**
     * 查询变色龙实时信息
     * 
     * @param params the params
     * @return the result object
     */
    ResultObject<Page<Map<String, Object>>> queryMinMap(Map<String, Object> params);

    /**
     * 查询导出
     *
     * @param params
     * @return
     */
    List<HashMap<String, Object>> exportMinMap(Map<String, Object> params);

    /**
     * 实时查询可视化视图
     * 
     * @param params
     * @return
     */
    ResultObject queryMinVisualViews(Map<String, Object> params);

    /**
     * 暂停活动
     *
     * @param activityInfo 活动信息
     * @return 操作结果
     */
    ResultObject<String> pauseActivity(ActivityInfo activityInfo);

    /**
     * 恢复活动
     *
     * @param activityInfo 活动信息
     * @return 操作结果
     */
    ResultObject<String> recoveryActivity(ActivityInfo activityInfo);

    /**
     * 变色龙全局频率设置
     * 
     * @param frequencyMap 配置信息
     * @return 操作结果
     */
    ResultObject<String> frequency(ActivityFrequency frequencyMap);

    /**
     * 获取变色龙全局弹窗状态
     * 
     * @return
     */
    ResultObject<String> getfreStatus();

    /**
     * 根据创建人，查询上一次的转化率阈值监控配置
     * 
     * @param creator
     * @return
     */
    ResultObject<HashMap<String, Object>> qrySettingsByCreator(String creator);

    /**
     * 创建或者更新转化率阈值监控配置
     * 
     * @param monitor
     * @return
     */
    ResultObject upsertSettings(RateMonitor monitor);
}
